from likeshop_project.BASE.myBase import Tools
from likeshop_project.API.login_api import login_module

class goodsLIST_module(Tools):
    path = "api/goods/getGoodsList"

    def goodsLIST_action(self, category_id, keyword='', sales_sum='desc', price='desc'):
        url = self.host_url + self.path
        data = {
            'category_id':category_id,
            'keyword': keyword,
            'sales_sum': sales_sum,
            'price': price,
        }
        head = login_module(session=self.session).get_head()
        msg = self.session.get(url=url, params=data,headers=head)
        return msg.json()
